package cn.hd.service.impl;

import cn.hd.dao.ProductDao;
import cn.hd.entity.Product;
import cn.hd.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class ProductImpl implements ProductService {
    @Autowired
    private ProductDao productDao;
    @Override
    public int addProduct(Product product) {
        return productDao.addProduct(product);
    }

    @Override
    public int delProduct(long id) {
        return productDao.delProduct(id);
    }

    @Override
    public List<Product> selectByNameProduct(Map map) {
        return productDao.selectByNameProduct(map);
    }
}
